package blog.util;

import lombok.Data;

@Data
public class Random {
    private final long timestamp = System.currentTimeMillis();
    private String prefix = "";
    private String suffix = "";
    private String separator = "_";

    public String getRandomName(){
        String name = "";
        if(prefix != null && !"".equals(prefix)){
            name += prefix + separator;
        }
        name += timestamp;
        if(!"".equals(suffix) && suffix != null){
            name += separator + suffix;
        }
        return String.valueOf(name);
    }
}
